package com.vint.mi;

import java.util.HashMap;
import java.util.Map;

/**
 * 1.done
 * 2.easy
 * 3.string
 */
public class Mi14 {
    public static String solution(String line){
        String[] src = line.split(" ");
        int v = Integer.parseInt(src[1]);
        Map<Integer,Integer> me = new HashMap<>();
        String[] src1 = src[0].split(",");
        for(int i=0; i<src1.length; i++){
            if(!me.containsKey(Integer.parseInt(src1[i]))){
                me.put(Integer.parseInt(src1[i]),i);
            }
        }
        if(me.containsKey(v)) {
            return Integer.toString(me.get(v));
        }else{
            return "-1";
        }
    }
    public static void main(String[] args){
        System.out.println(solution("4,5,6,7,0,1,2 6"));
        System.out.println(solution("4,5,6,7,0,1,2 0"));
    }
}
